
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
//#include <getopt.h>


//#include <cv.h>
#include <opencv2/core/core_c.h>
#include <opencv2/highgui/highgui_c.h>
#include <opencv2/imgproc/imgproc_c.h>
#include <opencv2/objdetect/objdetect.hpp>

#define getPixle(X,j,i) (unsigned char)(X->imageData + (i)*X->widthStep)[j]
#define setPixle(X,j,i,c) (X->imageData + (i)*X->widthStep)[j] = (unsigned char)c

#define getRedPixle(X,j,i) (unsigned char)(X->imageData + (i)*X->widthStep)[(j)*X->nChannels+2]
#define setRedPixle(X,j,i,c) (X->imageData + (i)*X->widthStep)[(j)*X->nChannels+2] = (unsigned char)c

#define getGreenPixle(X,j,i) (unsigned char)(X->imageData + (i)*X->widthStep)[(j)*X->nChannels+1]
#define setGreenPixle(X,j,i,c) (X->imageData + (i)*X->widthStep)[(j)*X->nChannels+1] = (unsigned char)c

#define getBluePixle(X,j,i) (unsigned char)(X->imageData + (i)*X->widthStep)[(j)*X->nChannels]
#define setBluePixle(X,j,i,c) (X->imageData + (i)*X->widthStep)[(j)*X->nChannels] = (unsigned char)c

typedef struct {
	CvPoint2D32f leye;
	CvPoint2D32f reye;
} EyesPoint;

int setUpFaceFinder();

int getFaceRec(IplImage *current_frame);

void mouseCallBack(int event, int x, int y, int flags, void* param);
void mouseCallBack_color(int event, int x, int y, int flags, void* param);

void getEyesPos(IplImage *image, CvPoint2D32f *leye, CvPoint2D32f *reye);
void getEyesPos_color(IplImage *image, CvPoint2D32f *leye, CvPoint2D32f *reye);

CvArr *createScreenTransform(float *imageCords);

